import { Post } from "@/library/utils/request"
import * as types from "@/views/dishes_manager/dishes_list/types"
import { ResponseWithCount } from "@/library/common/types"

export const DishesListApiUrl = {
    Select: "/Dishes/Select",
    Insert: "/Dishes/Insert",
    Update: "/Dishes/Update",
    Delete: "/Dishes/Delete",
}

export const DishesListApi = {
    /**
     * 查询
     */
    Select(params: types.SelectParamsType) {
        return Post<ResponseWithCount<types.DataType[]>>(DishesListApiUrl.Select, params)
    },
    /**
     * 新增
     */
    Insert(params: types.InsertType) {
        return Post(DishesListApiUrl.Insert, params)
    },
    /**
     * 更新
     */
    Update(params: types.UpdateType) {
        return Post(DishesListApiUrl.Update, params)
    },
    /**
     * 删除
     */
    Delete(params: types.DeleteType) {
        return Post(DishesListApiUrl.Delete, params)
    },
}